package com.weijian.job.once;

import com.weijian.service.ArticleService;
import com.weijian.utils.SyncVectorUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.ai.vectorstore.VectorStore;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * 首次启动时全量同步数据库中的政策到 es
 */
//@Component
@Slf4j
@RequiredArgsConstructor
public class FullSyncPostToEs implements CommandLineRunner {

    final ArticleService articleService;

    final VectorStore vectorStore;

    @Override
    public void run(String... args) {
        SyncVectorUtil.syncInit(articleService, vectorStore);
    }

}
